package com.android.youwenchuang.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.android.youwenchuang.bean.Car;
import com.android.youwenchuang.bean.Circle;
import com.android.youwenchuang.bean.Goods;
import com.android.youwenchuang.bean.Message;
import com.android.youwenchuang.bean.News;
import com.android.youwenchuang.bean.Order;
import com.android.youwenchuang.bean.User;

import com.android.youwenchuang.gen.CarDao;
import com.android.youwenchuang.gen.CircleDao;
import com.android.youwenchuang.gen.GoodsDao;
import com.android.youwenchuang.gen.MessageDao;
import com.android.youwenchuang.gen.NewsDao;
import com.android.youwenchuang.gen.OrderDao;
import com.android.youwenchuang.gen.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig carDaoConfig;
    private final DaoConfig circleDaoConfig;
    private final DaoConfig goodsDaoConfig;
    private final DaoConfig messageDaoConfig;
    private final DaoConfig newsDaoConfig;
    private final DaoConfig orderDaoConfig;
    private final DaoConfig userDaoConfig;

    private final CarDao carDao;
    private final CircleDao circleDao;
    private final GoodsDao goodsDao;
    private final MessageDao messageDao;
    private final NewsDao newsDao;
    private final OrderDao orderDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        carDaoConfig = daoConfigMap.get(CarDao.class).clone();
        carDaoConfig.initIdentityScope(type);

        circleDaoConfig = daoConfigMap.get(CircleDao.class).clone();
        circleDaoConfig.initIdentityScope(type);

        goodsDaoConfig = daoConfigMap.get(GoodsDao.class).clone();
        goodsDaoConfig.initIdentityScope(type);

        messageDaoConfig = daoConfigMap.get(MessageDao.class).clone();
        messageDaoConfig.initIdentityScope(type);

        newsDaoConfig = daoConfigMap.get(NewsDao.class).clone();
        newsDaoConfig.initIdentityScope(type);

        orderDaoConfig = daoConfigMap.get(OrderDao.class).clone();
        orderDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        carDao = new CarDao(carDaoConfig, this);
        circleDao = new CircleDao(circleDaoConfig, this);
        goodsDao = new GoodsDao(goodsDaoConfig, this);
        messageDao = new MessageDao(messageDaoConfig, this);
        newsDao = new NewsDao(newsDaoConfig, this);
        orderDao = new OrderDao(orderDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(Car.class, carDao);
        registerDao(Circle.class, circleDao);
        registerDao(Goods.class, goodsDao);
        registerDao(Message.class, messageDao);
        registerDao(News.class, newsDao);
        registerDao(Order.class, orderDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        carDaoConfig.clearIdentityScope();
        circleDaoConfig.clearIdentityScope();
        goodsDaoConfig.clearIdentityScope();
        messageDaoConfig.clearIdentityScope();
        newsDaoConfig.clearIdentityScope();
        orderDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public CarDao getCarDao() {
        return carDao;
    }

    public CircleDao getCircleDao() {
        return circleDao;
    }

    public GoodsDao getGoodsDao() {
        return goodsDao;
    }

    public MessageDao getMessageDao() {
        return messageDao;
    }

    public NewsDao getNewsDao() {
        return newsDao;
    }

    public OrderDao getOrderDao() {
        return orderDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
